﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;
namespace ClassSystem
{
    public partial class ASPStudentAbout : System.Web.UI.Page
    {
        KQBLL bll = new KQBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Label1.Text = DateTime.Now.ToLongDateString().ToString();
        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtdate.Text == null && this.txtroom.Text == null && this.txteacher.Text == null)
            {
                Response.Write("alert('不能为空！')");
            }
            else
            {
                KQModel DM = new KQModel();
                DM.TheDay = Convert.ToDateTime(this.txtdate.Text.Trim());
                DM.TheRoom = this.txtroom.Text.Trim();
                DM.TheClass = this.txtclass.Text.Trim();
                DM.TheHumans = Convert.ToInt32(this.txtyingdao.Text.Trim());
                DM.ThePeople = Convert.ToInt32(this.txtshidao.Text.Trim());
                DM.TheOut = Convert.ToInt32(this.txtweidao.Text.Trim());
                DM.TheQuestion = this.txtweidaoyuanyin.Text.Trim();
                DM.TheTeacher = this.txteacher.Text.Trim();
                if (bll.ADD(DM))
                {

                    Response.Write("<script>alert('提交成功')</script>");
                }
                else
                {
                    Response.Write("<script>alert('提交失败')</script>");
                }
            }
        }
    }
}